home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / com_net / tcp / amitcp / netinclude / sys / param.h < prev    next >
C/C++ Source or Header  |  2000-01-01  |  3KB  |  122 lines

  1. #ifndef SYS_PARAM_H
  2. #define SYS_PARAM_H \
  3. /*
  4. **      $Filename: sys/param.h $
  5. **    $Release$
  6. **      $Revision: 3.1 $
  7. **      $Date: 1994/02/03 11:46:16 $
  8. **
  9. **    Definitions of some system parameters, FD_SET macros
  10. **
  11. **    Copyright © 1993,1994 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  12. **                  Helsinki University of Technology, Finland.
  13. **                  All rights reserved.
  14. */
  15.  
  16. /*
  17.  * AmiTCP/IP is not BSD4.3 compatible
  18.  */
  19. #define    BSD    199402    /* Feb, 1994 system version (year & month) */
  20. #define BSD4_3    1
  21. #define BSD4_4    1
  22.  
  23. #ifndef SYS_TYPES_H
  24. #include <sys/types.h>
  25. #endif
  26.  
  27. #define NOFILE        FD_SETSIZE /* perhaps we shouldn't use FD_SETSIZE */
  28.  
  29. #define    BIG_ENDIAN    4321    /* MSB first: 68000, ibm, net */
  30. #define    BYTE_ORDER    BIG_ENDIAN
  31.  
  32. #define MAXHOSTNAMELEN  64    /* max length of hostname */
  33. #define MAXLOGNAME      32    /* max length of login name */
  34.  
  35. /*
  36.  * Macros for network/external number representation conversion.
  37.  */
  38. #ifndef ntohl
  39. #define    ntohl(x)    (x)
  40. #define    ntohs(x)    (x)
  41. #define    htonl(x)    (x)
  42. #define    htons(x)    (x)
  43.  
  44. #define    NTOHL(x)    (x)
  45. #define    NTOHS(x)    (x)
  46. #define    HTONL(x)    (x)
  47. #define    HTONS(x)    (x)
  48. #endif
  49.  
  50. /* Limits */
  51. #if __SASC
  52. #ifndef _LIMITS_H
  53. #include <limits.h>
  54. #endif
  55. #elif __GNUC__
  56. #ifndef _MACHINE_LIMITS_H
  57. #include <machine/limits.h>
  58. #endif
  59. #undef LONGBITS            /* exec/types wants to use this symbol */
  60. #undef BITSPERBYTE        /* dos/dos.h defines this */
  61. #undef MAXINT            /* dos/dos.h defines this */
  62. #undef MININT            /* dos/dos.h defines this */
  63. #endif
  64.  
  65. /* Bit map related macros. */
  66. #define    setbit(a,i)    ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  67. #define    clrbit(a,i)    ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  68. #define    isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  69. #define    isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  70.  
  71. /* Macros for counting and rounding. */
  72. #ifndef howmany
  73. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  74. #endif
  75. #define    roundup(x, y)    ((((x)+((y)-1))/(y))*(y))
  76. #define powerof2(x)    ((((x)-1)&(x))==0)
  77.  
  78. #ifndef KERNEL            /* Kernel has these in kern/amiga_subr.h */
  79. #if __SASC            /* SASC has built-in versions */
  80. #ifndef _STRING_H
  81. #ifndef USE_BUILTIN_MATH
  82. #define USE_BUILTIN_MATH
  83. #endif
  84. #include <string.h>
  85. #endif
  86.  
  87. #else
  88.  
  89. #ifndef min
  90. #define min(x,y) ((x) < (y) ? (x) : (y))
  91. #endif
  92. #ifndef max
  93. #define max(x,y) ((x) > (y) ? (x) : (y))
  94. #endif
  95.  
  96. #endif
  97. #endif /* !KERNEL */
  98.  
  99. /* More types and definitions used throughout the kernel. */
  100. #ifdef KERNEL
  101.  
  102. #ifndef SYS_CDEFS_H
  103. #include <sys/cdefs.h>
  104. #endif
  105.  
  106. #ifndef SYS_ERRNO_H
  107. #include <sys/errno.h>
  108. #endif
  109.  
  110. #ifndef SYS_TIME_H
  111. #include <sys/time.h>
  112. #endif
  113.  
  114. #ifndef SYS_UIO_H
  115. #include <sys/uio.h>
  116. #endif
  117.  
  118. #endif /* KERNEL */
  119. #endif /* !SYS_PARAM_H */
  120.  
  121.  
  122.